using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace DTO
{
	/// <summary> 
	///Author: nnamthach@gmail.com 
	/// <summary>
	
    public class LKCInfo
    {
		#region Local Variable
		public enum Field
		{
			TVC_DB,
			LOOKUP,
			CREATEDBY,
			MODIFIEDBY,
			CREATEDDATE,
			MODIFIEDDATE,
			CODE,
			DESCRIPTION,
			HEADER,
			NONVALIDATED,
			LENTH,
			QDID,
			CODENODE,
			DESCNODE,
			LKNODE,
			STANODE
		}
		private String _TVC_DB;
		private String _LOOKUP;
		private String _CREATEDBY;
		private String _MODIFIEDBY;
		private Int32 _CREATEDDATE;
		private Int32 _MODIFIEDDATE;
		private String _CODE;
		private String _DESCRIPTION;
		private String _HEADER;
		private String _NONVALIDATED;
		private String _LENTH;
		private String _QDID;
		private String _CODENODE;
		private String _DESCNODE;
		private String _LKNODE;
		private String _STANODE;
		
		public String TVC_DB{	get{ return _TVC_DB;} set{_TVC_DB = value;} }
		public String LOOKUP{	get{ return _LOOKUP;} set{_LOOKUP = value;} }
		public String CREATEDBY{	get{ return _CREATEDBY;} set{_CREATEDBY = value;} }
		public String MODIFIEDBY{	get{ return _MODIFIEDBY;} set{_MODIFIEDBY = value;} }
		public Int32 CREATEDDATE{	get{ return _CREATEDDATE;} set{_CREATEDDATE = value;} }
		public Int32 MODIFIEDDATE{	get{ return _MODIFIEDDATE;} set{_MODIFIEDDATE = value;} }
		public String CODE{	get{ return _CODE;} set{_CODE = value;} }
		public String DESCRIPTION{	get{ return _DESCRIPTION;} set{_DESCRIPTION = value;} }
		public String HEADER{	get{ return _HEADER;} set{_HEADER = value;} }
		public String NONVALIDATED{	get{ return _NONVALIDATED;} set{_NONVALIDATED = value;} }
		public String LENTH{	get{ return _LENTH;} set{_LENTH = value;} }
		public String QDID{	get{ return _QDID;} set{_QDID = value;} }
		public String CODENODE{	get{ return _CODENODE;} set{_CODENODE = value;} }
		public String DESCNODE{	get{ return _DESCNODE;} set{_DESCNODE = value;} }
		public String LKNODE{	get{ return _LKNODE;} set{_LKNODE = value;} }
		public String STANODE{	get{ return _STANODE;} set{_STANODE = value;} }
		
        #endregion LocalVariable
        
        #region Constructor
		public LKCInfo()
		{
			_TVC_DB = "";
			_LOOKUP = "";
			_CREATEDBY = "";
			_MODIFIEDBY = "";
			_CREATEDDATE = 0;
			_MODIFIEDDATE = 0;
			_CODE = "";
			_DESCRIPTION = "";
			_HEADER = "";
			_NONVALIDATED = "";
			_LENTH = "";
			_QDID = "";
			_CODENODE = "";
			_DESCNODE = "";
			_LKNODE = "";
			_STANODE = "";
		}
		public LKCInfo(
		String TVC_DB,
		String LOOKUP,
		String CREATEDBY,
		String MODIFIEDBY,
		Int32 CREATEDDATE,
		Int32 MODIFIEDDATE,
		String CODE,
		String DESCRIPTION,
		String HEADER,
		String NONVALIDATED,
		String LENTH,
		String QDID,
		String CODENODE,
		String DESCNODE,
		String LKNODE,
		String STANODE
		)
		{
			_TVC_DB = TVC_DB;
			_LOOKUP = LOOKUP;
			_CREATEDBY = CREATEDBY;
			_MODIFIEDBY = MODIFIEDBY;
			_CREATEDDATE = CREATEDDATE;
			_MODIFIEDDATE = MODIFIEDDATE;
			_CODE = CODE;
			_DESCRIPTION = DESCRIPTION;
			_HEADER = HEADER;
			_NONVALIDATED = NONVALIDATED;
			_LENTH = LENTH;
			_QDID = QDID;
			_CODENODE = CODENODE;
			_DESCNODE = DESCNODE;
			_LKNODE = LKNODE;
			_STANODE = STANODE;
		}
		public LKCInfo(DataRow dr)
		{
			if (dr != null)
			{
				_TVC_DB = dr[Field.TVC_DB.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.TVC_DB.ToString()]);
				_LOOKUP = dr[Field.LOOKUP.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.LOOKUP.ToString()]);
				_CREATEDBY = dr[Field.CREATEDBY.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.CREATEDBY.ToString()]);
				_MODIFIEDBY = dr[Field.MODIFIEDBY.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.MODIFIEDBY.ToString()]);
				_CREATEDDATE = dr[Field.CREATEDDATE.ToString()] == DBNull.Value?0:Convert.ToInt32(dr[Field.CREATEDDATE.ToString()]);
				_MODIFIEDDATE = dr[Field.MODIFIEDDATE.ToString()] == DBNull.Value?0:Convert.ToInt32(dr[Field.MODIFIEDDATE.ToString()]);
				_CODE = dr[Field.CODE.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.CODE.ToString()]);
				_DESCRIPTION = dr[Field.DESCRIPTION.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.DESCRIPTION.ToString()]);
				_HEADER = dr[Field.HEADER.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.HEADER.ToString()]);
				_NONVALIDATED = dr[Field.NONVALIDATED.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.NONVALIDATED.ToString()]);
				_LENTH = dr[Field.LENTH.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.LENTH.ToString()]);
				_QDID = dr[Field.QDID.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.QDID.ToString()]);
				_CODENODE = dr[Field.CODENODE.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.CODENODE.ToString()]);
				_DESCNODE = dr[Field.DESCNODE.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.DESCNODE.ToString()]);
				_LKNODE = dr[Field.LKNODE.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.LKNODE.ToString()]);
				_STANODE = dr[Field.STANODE.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.STANODE.ToString()]);
			}
		}
        public LKCInfo(DataRowView dr)
        {
            if (dr != null)
            {
                _TVC_DB = dr[Field.TVC_DB.ToString()] == DBNull.Value ? "" : Convert.ToString(dr[Field.TVC_DB.ToString()]);
                _LOOKUP = dr[Field.LOOKUP.ToString()] == DBNull.Value ? "" : Convert.ToString(dr[Field.LOOKUP.ToString()]);
                _CREATEDBY = dr[Field.CREATEDBY.ToString()] == DBNull.Value ? "" : Convert.ToString(dr[Field.CREATEDBY.ToString()]);
                _MODIFIEDBY = dr[Field.MODIFIEDBY.ToString()] == DBNull.Value ? "" : Convert.ToString(dr[Field.MODIFIEDBY.ToString()]);
                _CREATEDDATE = dr[Field.CREATEDDATE.ToString()] == DBNull.Value ? 0 : Convert.ToInt32(dr[Field.CREATEDDATE.ToString()]);
                _MODIFIEDDATE = dr[Field.MODIFIEDDATE.ToString()] == DBNull.Value ? 0 : Convert.ToInt32(dr[Field.MODIFIEDDATE.ToString()]);
                _CODE = dr[Field.CODE.ToString()] == DBNull.Value ? "" : Convert.ToString(dr[Field.CODE.ToString()]);
                _DESCRIPTION = dr[Field.DESCRIPTION.ToString()] == DBNull.Value ? "" : Convert.ToString(dr[Field.DESCRIPTION.ToString()]);
                _HEADER = dr[Field.HEADER.ToString()] == DBNull.Value ? "" : Convert.ToString(dr[Field.HEADER.ToString()]);
                _NONVALIDATED = dr[Field.NONVALIDATED.ToString()] == DBNull.Value ? "" : Convert.ToString(dr[Field.NONVALIDATED.ToString()]);
                _LENTH = dr[Field.LENTH.ToString()] == DBNull.Value ? "" : Convert.ToString(dr[Field.LENTH.ToString()]);
                _QDID = dr[Field.QDID.ToString()] == DBNull.Value ? "" : Convert.ToString(dr[Field.QDID.ToString()]);
                _CODENODE = dr[Field.CODENODE.ToString()] == DBNull.Value ? "" : Convert.ToString(dr[Field.CODENODE.ToString()]);
                _DESCNODE = dr[Field.DESCNODE.ToString()] == DBNull.Value ? "" : Convert.ToString(dr[Field.DESCNODE.ToString()]);
                _LKNODE = dr[Field.LKNODE.ToString()] == DBNull.Value ? "" : Convert.ToString(dr[Field.LKNODE.ToString()]);
                _STANODE = dr[Field.STANODE.ToString()] == DBNull.Value ? "" : Convert.ToString(dr[Field.STANODE.ToString()]);
            }
        }
		public LKCInfo(LKCInfo objEntr)
		{			
			_TVC_DB = objEntr.TVC_DB;			
			_LOOKUP = objEntr.LOOKUP;			
			_CREATEDBY = objEntr.CREATEDBY;			
			_MODIFIEDBY = objEntr.MODIFIEDBY;			
			_CREATEDDATE = objEntr.CREATEDDATE;			
			_MODIFIEDDATE = objEntr.MODIFIEDDATE;			
			_CODE = objEntr.CODE;			
			_DESCRIPTION = objEntr.DESCRIPTION;			
			_HEADER = objEntr.HEADER;			
			_NONVALIDATED = objEntr.NONVALIDATED;			
			_LENTH = objEntr.LENTH;			
			_QDID = objEntr.QDID;			
			_CODENODE = objEntr.CODENODE;			
			_DESCNODE = objEntr.DESCNODE;			
			_LKNODE = objEntr.LKNODE;			
			_STANODE = objEntr.STANODE;			
		}
        #endregion Constructor
        
        #region InitTable
		public static DataTable ToDataTable()
		{
			DataTable dt = new DataTable("LKC");
			dt.Columns.AddRange(new DataColumn[] { 
				new DataColumn(Field.TVC_DB.ToString(), typeof(String)),
				new DataColumn(Field.LOOKUP.ToString(), typeof(String)),
				new DataColumn(Field.CREATEDBY.ToString(), typeof(String)),
				new DataColumn(Field.MODIFIEDBY.ToString(), typeof(String)),
				new DataColumn(Field.CREATEDDATE.ToString(), typeof(Int32)),
				new DataColumn(Field.MODIFIEDDATE.ToString(), typeof(Int32)),
				new DataColumn(Field.CODE.ToString(), typeof(String)),
				new DataColumn(Field.DESCRIPTION.ToString(), typeof(String)),
				new DataColumn(Field.HEADER.ToString(), typeof(String)),
				new DataColumn(Field.NONVALIDATED.ToString(), typeof(String)),
				new DataColumn(Field.LENTH.ToString(), typeof(String)),
				new DataColumn(Field.QDID.ToString(), typeof(String)),
				new DataColumn(Field.CODENODE.ToString(), typeof(String)),
				new DataColumn(Field.DESCNODE.ToString(), typeof(String)),
				new DataColumn(Field.LKNODE.ToString(), typeof(String)),
				new DataColumn(Field.STANODE.ToString(), typeof(String))
			});
			return dt;
		}
		public DataRow ToDataRow(DataTable dt)
		{
			DataRow row = dt.NewRow();
			row[Field.TVC_DB.ToString()] = _TVC_DB;
			row[Field.LOOKUP.ToString()] = _LOOKUP;
			row[Field.CREATEDBY.ToString()] = _CREATEDBY;
			row[Field.MODIFIEDBY.ToString()] = _MODIFIEDBY;
			row[Field.CREATEDDATE.ToString()] = _CREATEDDATE;
			row[Field.MODIFIEDDATE.ToString()] = _MODIFIEDDATE;
			row[Field.CODE.ToString()] = _CODE;
			row[Field.DESCRIPTION.ToString()] = _DESCRIPTION;
			row[Field.HEADER.ToString()] = _HEADER;
			row[Field.NONVALIDATED.ToString()] = _NONVALIDATED;
			row[Field.LENTH.ToString()] = _LENTH;
			row[Field.QDID.ToString()] = _QDID;
			row[Field.CODENODE.ToString()] = _CODENODE;
			row[Field.DESCNODE.ToString()] = _DESCNODE;
			row[Field.LKNODE.ToString()] = _LKNODE;
			row[Field.STANODE.ToString()] = _STANODE;
			return row;
		}
        #endregion InitTable
    }
}
